<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0"><meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
        <title>Welcome to Design Zone......</title>
        <link rel="stylesheet" type="text/css" href="../../scripts/ext/resources/css/ext-all.css" />
        <link rel="stylesheet" type="text/css" href="../../scripts/ext/resources/css/file-upload.css" />
        <link rel="stylesheet" type="text/css" href="../../styles/dzbase.css" />
        <script type="text/javascript" src="../../scripts/ext/adapter/ext-base.js">
        </script>
        <script type="text/javascript" src="../../scripts/ext/ext-all.js">
        </script>
        <script type="text/javascript" src="../../scripts/ext/ext-all.js">
        </script>
        <script type="text/javascript" src="../../scripts/form/FileUploadField.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/GroupSummary.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/RowExpander.js">
        </script>
        <script type="text/javascript" src="../../scripts/menu/EditableItem.js">
        </script>
        <script type="text/javascript" src="../../scripts/menu/RangeMenu.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/GridFilters.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/Filter.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/StringFilter.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/DateFilter.js">
        </script>
        <script type="text/javascript" src="../../scripts/grid/filter/ListFilter.js">
        </script>
        <script type="text/javascript" src="../../scripts/i18nMessage.js">
        </script>
        <script type="text/javascript" src="../../scripts/utils.js">
        </script>
        <script type="text/javascript" src="../../scripts/selectProductIdentification.js">
        </script>
        <script type="text/javascript" src="../../scripts/selectBiFranceCustomerEshop.js">
        </script>
        <script type="text/javascript" src="../../scripts/imageViewer.js"></script>
        <script type="text/javascript">
        	var piMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.productidentification');
			var referenceMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.reference');
			var yarnMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.yarn');
            var orderMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.order');
			var fcMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.francecustomer');
			var fceMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.francecustomereshop');
			var fMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.factory');
            var message = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=message');
			var buttonMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.accessorybutton');
			var colorMessage = new i18nMessage('../../servlet/I18nMessageServlet?keyPrefix=ui.pantonecolor');
			var ctYesnoXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtYesno');
			var ctOrderTypeXmlLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtOrderType');
			var ctSeasonNumberLoader = new xmlLoader('../../servlet/CodeTableServlet?name=CtSeasonNumber');
			
			var ctYesnoStore = new Ext.data.Store({
                    reader: new Ext.data.XmlReader({
                        record: 'item',
                        id: 'code',
                        totalRecords: 'itemTotal'
                    }, ['code', 'description']),
                    data: ctYesnoXmlLoader.getXml()
                });
                
			var ctOrderTypeStore = new Ext.data.Store({
                reader: new Ext.data.XmlReader({
                    record: 'item',
                    id: 'code',
                    totalRecords: 'itemTotal'
                }, ['code', 'description']),
                data: ctOrderTypeXmlLoader.getXml()
            });

			var ctSeasonNumberStore = new Ext.data.Store({
                reader: new Ext.data.XmlReader({
                    record: 'item',
                    id: 'code',
                    totalRecords: 'itemTotal'
                }, [ 
                'code', 'description']),
				data: ctSeasonNumberLoader.getXml()
            });
            
            var ctOrderTypeCombo = new Ext.form.ComboBox({
                fieldLabel: orderMessage.get('ui.order.productordertype'),
                id: 'ctOrderType',
                name: 'ctOrderType',
                allowBlank: false,
                blankText: message.get('message.edit.noblank'),
                valueField: 'code',
                typeAhead: true,
                store: ctOrderTypeStore,
                displayField: 'description',
                forceSelection: true,
                anchor: '80%',
                width: '80%',
                triggerAction: 'all',
                emptyText: message.get('message.combo.pleaseselect'),
                selectOnFocus: true,
                mode: 'local'
            });
            
            var isConfirmedCombo = new Ext.form.ComboBox({
                    fieldLabel: orderMessage.get('ui.order.isconfirmed'),
                    id: 'isConfirmed',
                    name: 'isConfirmed',
                    allowBlank: false,
                    blankText: message.get('message.edit.noblank'),
                    editable: false,
                    store: ctYesnoStore,
                    valueField: 'code',
                    displayField: 'description',
                    triggerAction: 'all',
                    emptyText: message.get('message.combo.pleaseselect'),
                    selectOnFocus: true,
                    anchor: '80%',
                    mode: 'local',
					listeners: {
						select: {
							fn: function (thisCombo, record,index){
								var isConfirmed = isConfirmedCombo.getValue();
								if(isConfirmed == '01'){
									Ext.getCmp('confirmedDate').enable();
								}else{
									Ext.getCmp('confirmedDate').disable();
								}
							}
						}
					}
                });

            var ctSeasonNumberCombo = new Ext.form.ComboBox({
                fieldLabel: piMessage.get('ui.productidentification.seasonnumber'),
                id: 'ctSeasonNumber',
                name: 'ctSeasonNumber',
                allowBlank: false,
                blankText: message.get('message.edit.noblank'),
                valueField: 'code',
                typeAhead: true,
                store: ctSeasonNumberStore,
                displayField: 'description',
                forceSelection: true,
                triggerAction: 'all',
                emptyText: message.get('message.combo.pleaseselect'),
                selectOnFocus: true,
                anchor: '80%',
                mode: 'local',
				listeners: {
					select: {
						fn: function (thisComb, record,index){
							//setReference();
						}
					}
				}
            });
            
            var isEshopCombo = new Ext.form.ComboBox({
                fieldLabel: orderMessage.get('ui.order.echop'),
                id: 'isEshop',
                name: 'isEshop',
                allowBlank: false,
                blankText: message.get('message.edit.noblank'),
                valueField: 'code',
                typeAhead: true,
                store: ctYesnoStore,
                displayField: 'description',
                forceSelection: true,
                triggerAction: 'all',
                emptyText: message.get('message.combo.pleaseselect'),
                selectOnFocus: true,
                anchor: '80%',
                mode: 'local',
				listeners: {
					select: {
						fn: function (thisComb, record,index){
							if(isEshopCombo.getValue() == '01'){
								Ext.getCmp('eshopSet1').expand();
								Ext.getCmp('eshopSet2').expand();
								enableEshop();
								selectFranceCustomerEshop(selectFranceCustomerEshopCallback);
							}else{
								disableEshop();
								Ext.getCmp('eshopSet1').collapse();
								Ext.getCmp('eshopSet2').collapse();
							}
						}
					}
				}
            }); 
            
            var orderProductForm;
            var selectedProductIdentification;
            
            var selectProductIdentificationCallback = function(){
            	Ext.getCmp('piId').setValue(selectedProductIdentification.id);
            	Ext.getCmp('piReference').setValue(selectedProductIdentification.reference);
            	Ext.getCmp('style').setValue(selectedProductIdentification.ctCollarType + '  ' + selectedProductIdentification.ctProductIdentificationStyle);
            	//Ext.getCmp('orderNumber').setValue(selectedProductIdentification.orderNumber);
            	//Ext.getCmp('createDate').setValue(selectedProductIdentification.createDate);
            	//Ext.getCmp('ctSeasonNumber').setValue(selectedProductIdentification.ctSeasonNumber);
            	//Ext.getCmp('ctCollarType').setValue(selectedProductIdentification.ctCollarType);
            	//Ext.getCmp('ctVersion').setValue(selectedProductIdentification.ctVersion);
            	//Ext.getCmp('reference').setValue(selectedProductIdentification.reference);
            	Ext.getCmp('customerName').setValue(selectedProductIdentification['biFranceCustomer.name']);
            	//Ext.getCmp('biMeasureSpecificationName').setValue(selectedProductIdentification.biMeasureSpecificationName);
            	//Ext.getCmp('referenceAs').setValue(selectedProductIdentification.referenceAs);
            	Ext.getCmp('customerDepartment').setValue(selectedProductIdentification['biFranceCustomer.department']);
            	Ext.getCmp('mainComposition').setValue(selectedProductIdentification.mainComposition);
            	//Ext.getCmp('ctDesignType').setValue(selectedProductIdentification.ctDesignType);
            	//Ext.getCmp('weight').setValue(selectedProductIdentification.weight);
            	document.getElementById('customImg').src =  '../../_temp/' + selectedProductIdentification.sketch1Name;
				document.getElementById('customImg1').src =  '../../_temp/' + selectedProductIdentification.sketch2Name;
            }
            
            var selectFranceCustomerEshopCallback = function(id, 
            		accountNumber, 
            		email,
            		title,
            		firstName, 
            		lastName, 
            		streetAddress,
            		phoneNumber, 
            		postalCode, 
            		city,
            		country,
            		bTitle,
            		bFirstName, 
            		bLastName, 
            		bStreetAddress,
            		bPhoneNumber, 
            		bPostalCode, 
            		bCity,
            		bCountry){
            	Ext.getCmp('biFranceCustomerEshopId').setValue(id);
            	Ext.getCmp('accountNumber').setValue(accountNumber);
            	Ext.getCmp('title').setValue(title);
            	Ext.getCmp('phoneNumber').setValue(phoneNumber);
            	Ext.getCmp('email').setValue(email);
            	Ext.getCmp('firstName').setValue(firstName);
            	Ext.getCmp('city').setValue(city);
            	Ext.getCmp('lastName').setValue(lastName);
            	Ext.getCmp('country').setValue(country);
            	Ext.getCmp('postalCode').setValue(postalCode);
            	Ext.getCmp('streetAddress').setValue(streetAddress);
            	
            	Ext.getCmp('bTitle').setValue(bTitle);
            	Ext.getCmp('bFirstName').setValue(bFirstName);
            	Ext.getCmp('bLastName').setValue(bLastName);
            	Ext.getCmp('bStreetAddress').setValue(bStreetAddress);
            	Ext.getCmp('bPhoneNumber').setValue(bPhoneNumber);
            	Ext.getCmp('bPostalCode').setValue(bPostalCode);
            	Ext.getCmp('bCity').setValue(bCity);
            	Ext.getCmp('bCountry').setValue(bCountry);
            }
            
            var enableEshop = function(){
            	Ext.getCmp('accountNumber').enable();
            	Ext.getCmp('title').enable();
            	Ext.getCmp('phoneNumber').enable();
            	Ext.getCmp('email').enable();
            	Ext.getCmp('firstName').enable();
            	Ext.getCmp('city').enable();
            	Ext.getCmp('lastName').enable();
            	Ext.getCmp('country').enable();
            	Ext.getCmp('postalCode').enable();
            	Ext.getCmp('streetAddress').enable();
            	
            	Ext.getCmp('bTitle').enable();
            	Ext.getCmp('bPhoneNumber').enable();
            	Ext.getCmp('bFirstName').enable();
            	Ext.getCmp('bCity').enable();
            	Ext.getCmp('bLastName').enable();
            	Ext.getCmp('bCountry').enable();
            	Ext.getCmp('bPostalCode').enable();
            	Ext.getCmp('bStreetAddress').enable();
            }
            
            var disableEshop = function(){
            	Ext.getCmp('accountNumber').disable();
            	Ext.getCmp('title').disable();
            	Ext.getCmp('phoneNumber').disable();
            	Ext.getCmp('email').disable();
            	Ext.getCmp('firstName').disable();
            	Ext.getCmp('city').disable();
            	Ext.getCmp('lastName').disable();
            	Ext.getCmp('country').disable();
            	Ext.getCmp('postalCode').disable();
            	Ext.getCmp('streetAddress').disable();
            	
            	Ext.getCmp('bTitle').disable();
            	Ext.getCmp('bPhoneNumber').disable();
            	Ext.getCmp('bFirstName').disable();
            	Ext.getCmp('bCity').disable();
            	Ext.getCmp('bLastName').disable();
            	Ext.getCmp('bCountry').disable();
            	Ext.getCmp('bPostalCode').disable();
            	Ext.getCmp('bStreetAddress').disable();
            }
			
            Ext.onReady(function(){
                Ext.QuickTips.init();
                Ext.form.Field.prototype.msgTarget = 'side';
                
                var idValue = getPrarmeterValue(window.location, 'id');
                var startPage = getPrarmeterValue(window.location, 'startPage');
                
                orderProductForm = new Ext.FormPanel({
                    labelAlign: 'left',
                    url: '../../servlet/OrderProductServlet?action=1',
                    frame: true,
                    title: orderMessage.get('ui.order.editproduct'),
                    bodyStyle: 'padding:5px 5px 5px 5px;margin-top: 2px;',
                    width: '100%',
                    labelWidth: 135,
                    reader: new Ext.data.XmlReader({
                        record: 'item'
                    }, [{
                        name: 'id',
                        mapping: 'id'
                    },{
                        name: 'piId',
                        mapping: 'piId'
                    },{
                        name: 'piReference',
                        mapping: 'piReference'
                    },{
                        name: 'ctSeasonNumber',
                        mapping: 'ctSeasonNumber'
                    },{
                        name: 'sketch1Name',
                        mapping: 'sketch1Name'
                    },{
                        name: 'sketch2Name',
                        mapping: 'sketch2Name'
                    },{
                        name: 'sketch3Name',
                        mapping: 'sketch3Name'
                    },{
                        name: 'piReference',
                        mapping: 'piReference'
                    },{
                        name: 'customerName',
                        mapping: 'customerName'
                    },{
                        name: 'customerDepartment',
                        mapping: 'customerDepartment'
                    },{
                        name: 'createDate',
                        mapping: 'createDate'
                    },{
                        name: 'style',
                        mapping: 'style'
                    },{
                        name: 'departureDate',
                        mapping: 'departureDate'
                    },{
                        name: 'orderNumber',
                        mapping: 'orderNumber'
                    },{
                        name: 'mainComposition',
                        mapping: 'mainComposition'
                    },{
                    	name: 'isEshop',
                    	mapping: 'isEshop'
                    }, {
                        name: 'accountNumber',
                        mapping: 'accountNumber'
                    }, {
                        name: 'title',
                        mapping: 'title'
                    }, {
                        name: 'email',
                        mapping: 'email'
                    }, {
                        name: 'firstName',
                        mapping: 'firstName'
                    }, {
                        name: 'lastName',
                        mapping: 'lastName'
                    }, {
                        name: 'streetAddress',
                        mapping: 'streetAddress'
                    }, {
                        name: 'phoneNumber',
                        mapping: 'phoneNumber'
                    }, {
                        name: 'postalCode',
                        mapping: 'postalCode'
                    }, {
                        name: 'city',
                        mapping: 'city'
                    }, {
                        name: 'country',
                        mapping: 'country'
                    }, {
                        name: 'bTitle',
                        mapping: 'bTitle'
                    }, {
                        name: 'bFirstName',
                        mapping: 'bFirstName'
                    }, {
                        name: 'bLastName',
                        mapping: 'bLastName'
                    }, {
                        name: 'bStreetAddress',
                        mapping: 'bStreetAddress'
                    }, {
                        name: 'bPhoneNumber',
                        mapping: 'bPhoneNumber'
                    }, {
                        name: 'bPostalCode',
                        mapping: 'bPostalCode'
                    }, {
                        name: 'bCity',
                        mapping: 'bCity'
                    }, {
                        name: 'bCountry',
                        mapping: 'bCountry'
                    },{
                    	name: 'biFranceCustomerEshopId',
                    	mapping: 'biFranceCustomerEshopId'
                    }]),
                    items: [{
                            id: 'id',
                            name: 'id',
                            xtype: 'hidden'
                        },{
                            id: 'piId',
                            name: 'piId',
                            xtype: 'hidden'
                        },{
                            id: 'sketch1Name',
                            name: 'sketch1Name',
                            xtype: 'hidden'
                        },{
                            id: 'sketch2Name',
                            name: 'sketch2Name',
                            xtype: 'hidden'
                        },{
                            id: 'sketch3Name',
                            name: 'sketch3Name',
                            xtype: 'hidden'
                        },{
                            id: 'biFranceCustomerEshopId',
                            name: 'biFranceCustomerEshopId',
                            xtype: 'hidden'
                        }, {
                            layout: 'column',
                            labelWidth: 115,
                            items: [{
                                columnWidth: .33,
                                layout: 'form',
                                items: [ctSeasonNumberCombo,{
                                	id:'piReference',
                                    name: 'piReference',
                                    fieldLabel: piMessage.get('ui.productidentification.chart'),
                                    xtype: 'textfield',
                                    anchor: '86%',
                                    emptyText: message.get('message.combo.pleaseselect'),
                                    blankText: message.get('message.edit.noblank'),
                                    allowBlank: false,
                                    listeners: {
                                        'render': {
                                            fn: function(){
                                                Ext.getCmp('piReference').getEl().on('click', function(){
                                                    if(ctSeasonNumberCombo.getValue() == ''){
                                                    	messageTip.msg(message.get('message.tip'), message.get('message.edit.selectseasonnumber'));
                                                        return;
                                                    }
                                                    selectProductIdentification(selectProductIdentificationCallback, '', ctSeasonNumberCombo.getValue(),'',"2");
                                                }, this);
                                            },
                                            scope: this
                                        }
                                    }
                                },{
                                	id: 'customerName',
		                            name: 'customerName',
		                            fieldLabel: message.get('message.edit.customername'),
		                            xtype: 'textfield',
		                            anchor: '86%',
		                            readOnly: true,
		                            blankText: message.get('message.edit.noblank'),
		                            maxLength: 128
		                        },isEshopCombo]
                            }, {
                                columnWidth: .33,
                                layout: 'form',
                                items: [{
		                            name: 'createDate',
		                            fieldLabel: message.get('message.edit.date')+ "(d/m/Y)",
		                            xtype: 'datefield',
		                            anchor: '80%',
		                            allowBlank: false,
		                            blankText: message.get('message.edit.noblank'),
		                            maxLength: 128
		                        },{
                                	id: 'style',
		                            name: 'style',
		                            fieldLabel: piMessage.get('ui.productidentification.style'),
		                            xtype: 'textfield',
		                            anchor: '86%',
		                            readOnly: true,
		                            blankText: message.get('message.edit.noblank'),
		                            maxLength: 128
		                        },{
                                    xtype: 'textfield',
                                    fieldLabel: fcMessage.get('ui.francecustomer.department'),
                                    id: 'customerDepartment',
                                    name: 'customerDepartment',
                                    anchor: '86%',
                                    allowBlank: true,
                                    blankText: message.get('message.edit.noblank'),
                                    readOnly: true,
                                    maxLength: 64,
                                    tabIndex: 1
                                }]
                            }, {
                                columnWidth: .33,
                                layout: 'form',
                                items: [{
		                            name: 'departureDate',
		                            fieldLabel: orderMessage.get('ui.order.departuredata')+ "(d/m/Y)",
		                            xtype: 'datefield',
		                            anchor: '80%',
		                            blankText: message.get('message.edit.noblank'),
		                            maxLength: 128
		                        },{
                                    xtype: 'textfield',
                                    fieldLabel: yarnMessage.get('ui.yarn.composition'),
                                    id: 'mainComposition',
                                    name: 'mainComposition',
                                    anchor: '86%',
                                    allowBlank: true,
                                    blankText: message.get('message.edit.noblank'),
                                    readOnly: true,
                                    maxLength: 64,
                                    tabIndex: 1
                                },{
                                	id: 'orderNumber',
		                            name: 'orderNumber',
		                            fieldLabel: piMessage.get('ui.productidentification.ordernumber'),
		                            xtype: 'textfield',
		                            anchor: '86%',
		                            allowBlank: false,
		                            blankText: message.get('message.edit.noblank'),
		                            maxLength: 128,
									maxLengthText: message.get('message.edit.toolong')
		                        }]
                            }]
                        },{
                        	id: 'eshopSet1',
                            xtype: 'fieldset',
                            collapsible: true,
                            title: fceMessage.get('ui.francecustomereshop.edittitle') + ':&nbsp;&nbsp;&nbsp;&nbsp;' + fcMessage.get('ui.francecustomer.addressdelivery'),
                            autoHeight: true,
                            items: [{
		                            layout: 'column',
		                            items: [{
		                                columnWidth: .33,
		                                layout: 'form',
		                                items: [{
			                               	html:'<div>&nbsp;</div><br/>'
			                               },{
		   								 	id: 'title',
		                                    name: 'title',
		                                    fieldLabel: fceMessage.get('ui.francecustomereshop.title'),
		                                    xtype: 'textfield',
		                                    anchor: '86%',
		   								 	width: '90%',
		                                    allowBlank: false,
		                                    blankText: message.get('message.edit.noblank'),
		                                    maxLength: 64
		                                },{
			   								 id: 'postalCode',
			                                   name: 'postalCode',
			                                   fieldLabel: fceMessage.get('ui.francecustomereshop.postcode'),
			                                   xtype: 'textfield',
			                                   anchor: '86%',
			   								 width: '90%',
			                                   allowBlank: false,
			                                   blankText: message.get('message.edit.noblank'),
			                                   maxLength: 64
			                               }]
		   				
		   						 },{
		                                columnWidth: .33,
		                                layout: 'form',
		                                items: [{
		   								 	id: 'email',
		                                    name: 'email',
		                                    fieldLabel: 'E-Mail',
		                                    xtype: 'textfield',
		                                    anchor: '86%',
		   								 width: '90%',
		   								 allowBlank: false,
		                                    maxLength: 64
		                                },{
		   								 id: 'firstName',
		                                    name: 'firstName',
		                                    fieldLabel: fceMessage.get('ui.francecustomereshop.fname'),
		                                    xtype: 'textfield',
		                                    anchor: '86%',
		   								 width: '90%',
		   								 allowBlank: false,
		                                    maxLength: 64
		                                },{
		   								 id: 'city',
		                                    name: 'city',
		                                    fieldLabel: fceMessage.get('ui.francecustomereshop.city'),
		                                    xtype: 'textfield',
		                                    anchor: '86%',
		   								 width: '90%',
		                                    allowBlank: false,
		                                    blankText: message.get('message.edit.noblank'),
		                                    maxLength: 64
		                                }]
		   				
		   						},{
		                               columnWidth: .33,
		                               layout: 'form',
		                               items: [{
		   								 	id: 'accountNumber',
		                                    name: 'accountNumber',
		                                    fieldLabel: fceMessage.get('ui.francecustomereshop.account'),
		                                    xtype: 'textfield',
		                                    anchor: '86%',
		   								 	width: '90%',
		                                    allowBlank: false,
		                                    blankText: message.get('message.edit.noblank'),
		                                    maxLength: 64
		                                }, {
		   								 	id: 'lastName',
		                                    name: 'lastName',
		                                    fieldLabel: fceMessage.get('ui.francecustomereshop.lname'),
		                                    xtype: 'textfield',
		                                    anchor: '86%',
		   								 	width: '90%',
		   								 	allowBlank: false,
		                                    maxLength: 64
		                                },{
		   								 id: 'country',
		                                    name: 'country',
		                                    fieldLabel: fceMessage.get('ui.francecustomereshop.country'),
		                                    xtype: 'textfield',
		                                    anchor: '86%',
		   								 width: '90%',
		                                    allowBlank: false,
		                                    blankText: message.get('message.edit.noblank'),
		                                    maxLength: 64
		                                }]
		   				
		   						}]
		   					},{
		                           layout: 'column',
		                           items: [{
		                               columnWidth: .66,
		                               layout: 'form',
		                               items: [{
			   								 id: 'streetAddress',
			                                   name: 'streetAddress',
			                                   fieldLabel: fceMessage.get('ui.francecustomereshop.address'),
			                                   xtype: 'textarea',
			                                   anchor: '86%',
			   								 width: '90%',
			   								 allowBlank: false,
			                                   maxLength: 64
			                               }]
		   				
		   						 },{
		                               columnWidth: .33,
		                               layout: 'form',
		                               items: [{
		   								 	id: 'phoneNumber',
		                                    name: 'phoneNumber',
		                                    fieldLabel: fceMessage.get('ui.francecustomereshop.phonemumber'),
		                                    xtype: 'textfield',
		                                    anchor: '86%',
		   								 	width: '90%',
		                                    allowBlank: false,
		                                    blankText: message.get('message.edit.noblank'),
		                                    maxLength: 64
		                                }]
		   				
		   						}]
		   					}]
                        },{
                        	id: 'eshopSet2',
                            xtype: 'fieldset',
                            collapsible: true,
                            title: fceMessage.get('ui.francecustomereshop.edittitle') + ':&nbsp;&nbsp;&nbsp;&nbsp;' + fcMessage.get('ui.francecustomer.addressbill'),
                            autoHeight: true,
                            items: [{
		                            layout: 'column',
		                            items: [{
		                                columnWidth: .33,
		                                layout: 'form',
		                                items: [{
		   								 	id: 'bTitle',
		                                    name: 'bTitle',
		                                    fieldLabel: fceMessage.get('ui.francecustomereshop.title') + '&nbsp;&nbsp;&nbsp;&nbsp;<img src="../../images/icons/paste_plain.png" style="cursor: hand;" onclick="copyAddress();">',
		                                    xtype: 'textfield',
		                                    anchor: '86%',
		   								 	width: '90%',
		                                    allowBlank: false,
		                                    blankText: message.get('message.edit.noblank'),
		                                    maxLength: 64
		                                },{
			   								 id: 'bPostalCode',
			                                   name: 'bPostalCode',
			                                   fieldLabel: fceMessage.get('ui.francecustomereshop.postcode'),
			                                   xtype: 'textfield',
			                                   anchor: '86%',
			   								 width: '90%',
			                                   allowBlank: false,
			                                   blankText: message.get('message.edit.noblank'),
			                                   maxLength: 64
			                               }]
		   				
		   						 },{
		                                columnWidth: .33,
		                                layout: 'form',
		                                items: [{
		   								 	id: 'bFirstName',
		                                    name: 'bFirstName',
		                                    fieldLabel: fceMessage.get('ui.francecustomereshop.fname'),
		                                    xtype: 'textfield',
		                                    anchor: '86%',
		   								 width: '90%',
		   								 allowBlank: false,
		                                    maxLength: 64
		                                },{
		   								 	id: 'bCity',
		                                    name: 'bCity',
		                                    fieldLabel: fceMessage.get('ui.francecustomereshop.city'),
		                                    xtype: 'textfield',
		                                    anchor: '86%',
		   								 width: '90%',
		                                    allowBlank: false,
		                                    blankText: message.get('message.edit.noblank'),
		                                    maxLength: 64
		                                }]
		   				
		   						},{
		                               columnWidth: .33,
		                               layout: 'form',
		                               items: [{
		   								 	id: 'bLastName',
		                                    name: 'bLastName',
		                                    fieldLabel: fceMessage.get('ui.francecustomereshop.lname'),
		                                    xtype: 'textfield',
		                                    anchor: '86%',
		   								 	width: '90%',
		   								 	allowBlank: false,
		                                    maxLength: 64
		                                },{
		   								 id: 'bCountry',
		                                    name: 'bCountry',
		                                    fieldLabel: fceMessage.get('ui.francecustomereshop.country'),
		                                    xtype: 'textfield',
		                                    anchor: '86%',
		   								 width: '90%',
		                                    allowBlank: false,
		                                    blankText: message.get('message.edit.noblank'),
		                                    maxLength: 64
		                                }]
		   				
		   						}]
		   					},{
		                           layout: 'column',
		                           items: [{
		                               columnWidth: .66,
		                               layout: 'form',
		                               items: [{
			   								 id: 'bStreetAddress',
			                                   name: 'bStreetAddress',
			                                   fieldLabel: fceMessage.get('ui.francecustomereshop.address'),
			                                   xtype: 'textarea',
			                                   anchor: '86%',
			   								 width: '90%',
			   								 allowBlank: false,
			                                   maxLength: 64
			                               }]
		   				
		   						 },{
		                               columnWidth: .33,
		                               layout: 'form',
		                               items: [{
		   								 	id: 'bPhoneNumber',
		                                    name: 'bPhoneNumber',
		                                    fieldLabel: fceMessage.get('ui.francecustomereshop.phonemumber'),
		                                    xtype: 'textfield',
		                                    anchor: '86%',
		   								 	width: '90%',
		                                    allowBlank: false,
		                                    blankText: message.get('message.edit.noblank'),
		                                    maxLength: 64
		                                }]
		   				
		   						}]
		   					}]
                        }],
                    
                    buttons: [{
                        text: message.get('message.edit.save'),
                        handler: function(){
                            if (orderProductForm.getForm().isValid()) {
                            
								document.getElementsByName('ctSeasonNumber')[0].value = ctSeasonNumberCombo.getValue();
								document.getElementsByName('isEshop')[0].value = isEshopCombo.getValue();

                                orderProductForm.getForm().submit({
                                    method: 'post',
                                    success: function(form, action){
                                        messageTip.msg(message.get('message.tip'), message.get('message.edit.successful'));
                                        orderProductForm.getForm().reset();
                                        isEshopCombo.setValue('02');
	                                    isEshopCombo.fireEvent('select');
                                    },
                                    failure: function(form, action){
                                        messageTip.msg(message.get('message.tip'), message.get('message.edit.unsuccessful'));
                                    }
                                });
                            }
                        }
                    },
                     {
                        text: message.get('message.edit.reset'),
                        handler: function(){
                            orderProductForm.getForm().reset();
                        }
                    }, {
                        text: message.get('message.edit.cancel'),
                        handler: function(){
                            if (startPage != null) {
                                window.location = 'order_product_list.html?startPage=' + startPage;
                            }
                            else {
                                window.location = 'order_product_list.html';
                            }
                        }
                    }]
                });
                
                
                orderProductForm.render('orderProduct');
                new Ext.Resizable('customImg', {
                    wrap: true,
                    pinned: true,
                    dynamic: true,
                    handles: 'all',
                    draggable: true
                });

                new Ext.Resizable('customImg1', {
                    wrap: true,
                    pinned: true,
                    dynamic: true,
                    handles: 'all',
                    draggable: true
                });

                if (idValue != null) {
                    document.getElementById('id').value = idValue;
                    orderProductForm.getForm().load({
                        url: '../../servlet/OrderProductServlet?action=3&id=' + idValue,
                        waitMsg: Ext.LoadMask.prototype.msg,
                        success: function(form, action){
                        							
							document.getElementById('customImg').src =  '../../_temp/' + document.getElementById('sketch1Name').value;
							document.getElementById('customImg1').src =  '../../_temp/' + document.getElementById('sketch2Name').value;
							//document.getElementById('customImg2').src =  '../../_temp/' + document.getElementById('photo2Name').value;
							if(isEshopCombo.getValue() == '01'){
								Ext.getCmp('eshopSet1').expand();
								Ext.getCmp('eshopSet2').expand();
								enableEshop();
							}else{
								disableEshop();
								Ext.getCmp('eshopSet1').collapse();
								Ext.getCmp('eshopSet2').collapse();
							}
                        }
                    });
                }else{
                	isEshopCombo.setValue('02');
                }
                
            });
            
            var copyAddress = function(){
            	Ext.getCmp('bTitle').setValue(Ext.getCmp('title').getValue());
            	Ext.getCmp('bFirstName').setValue(Ext.getCmp('firstName').getValue());
            	Ext.getCmp('bLastName').setValue(Ext.getCmp('lastName').getValue());
            	Ext.getCmp('bStreetAddress').setValue(Ext.getCmp('streetAddress').getValue());
            	Ext.getCmp('bPhoneNumber').setValue(Ext.getCmp('phoneNumber').getValue());
            	Ext.getCmp('bPostalCode').setValue(Ext.getCmp('postalCode').getValue());
            	Ext.getCmp('bCity').setValue(Ext.getCmp('city').getValue());
            	Ext.getCmp('bCountry').setValue(Ext.getCmp('country').getValue());
            }
        </script>
    </head>
    <body>
        <div id="orderProduct">
        </div>
        <img id="customImg" src="../../_temp/noimage.gif"
			style="position: absolute; left: 20%; width: 250px;" />
		<img id="customImg1" src="../../_temp/noimage.gif"
			style="position: absolute; left: 60%; width: 250px;" />
    </body>
</html>